<?php

$lines1 = file('newchina.txt', FILE_IGNORE_NEW_LINES);
$lines2 = file('./namelist/allchinese.idx', FILE_IGNORE_NEW_LINES);

$old = array();
$new = array();

foreach($lines1 as $line) {
	$a = explode(',', $line);
	$new[$a[1]] = $a[0];
}

foreach($lines2 as $line) {
	$a = explode(',', $line);
	$old[$a[1]] = $a[0];
}

$all = array_merge($old, $new);

foreach($all as $name => $id) {
	echo $id . ',' . $name . "\r\n";
}


?>